import { ComponentContent } from '@kit.ArkUI';
import { UIContext } from '@ohos.arkui.UIContext';

export class windowtan {
  static ui: UIContext
  static contentshow: ComponentContent<Object>
  static options: Object;

  static setContext(context: UIContext) {
    this.ui = context
  }

  static setcontentshow(contentshow: ComponentContent<object>) {
    this.contentshow = contentshow
  }

  static setoptions(options: Object) {
    this.options = options;
  }

  static openDialog() {
    if (this.contentshow != null) {
      this.ui.getPromptAction().openCustomDialog(this.contentshow)
    }
  }

  static closeDialog() {
    if (this.contentshow != null) {
      this.ui.getPromptAction().closeCustomDialog(this.contentshow)
    }
  }

  static updateDialog(options: object) {
    if (this.contentshow != null) {
      this.ui.getPromptAction().updateCustomDialog(this.contentshow, options)
    }
  }
}